package easy

import (
	"workspace/node"
)

func MaxDepth(root *node.Node) int {
	if root == nil {
		return 0
	}
	childChildrenDepth := 0
	for _, children := range root.Children {
		childChildrenDepth = max(childChildrenDepth, MaxDepth(children))
	}
	return childChildrenDepth + 1
}
